<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Grid布局</title>
    <style>
        .parent {
            width: 400px;
            height: 400px;
            margin: 50px auto;
            background-color: cyan;

            /* ---------------- 网格布局 */
            display: grid;

            /* ---------------- 排列方式：默认行 */
            /* grid-auto-flow: row; */
            grid-auto-flow: column;

            /* ---------------- 单元格数量 */
            /* 2行3列 */
            grid-template-rows: repeat(2, 100px);
            grid-template-columns: 100px 100px 100px;

            /* ---------------- 隐式网格：根据数量自动创建 */
            /* 行，有效 */
            /* grid-auto-rows: auto; */
            /* grid-auto-rows: 150px; */

            /* 列，有效 */
            /* grid-auto-columns: auto; */
            grid-auto-columns: 150px;
        }

        .child {
            background-color: rgb(148, 235, 238);
        }
    </style>
</head>

<body>

    <div class="parent">
        <div class="child item01">1</div>
        <div class="child item02">2</div>
        <div class="child item03">3</div>
        <div class="child item04">4</div>
        <div class="child item05">5</div>
        <div class="child item06">6</div>
        <div class="child item06">7</div>
    </div>

</body>

</html>